/**
 * Wechat_class_map.java created by zhangzhidong 
 * at 下午5:39:42 2016年4月17日
 */
package pojo.weichatlab;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * @author zhangzhidong
 *
 */
@Entity
@Table(name = "wechat_class_map", catalog = "", schema = "")
public class WechatClassMap extends WechatBaseModel {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	int id;
	int wechatid;
	int classid;
	Date update_time;
	int times;
	String ip;
	String user;
	Float confidence;

	@OneToOne(targetEntity = Label.class)
	@JoinColumn(name = "classid", insertable = false, updatable = false,
			referencedColumnName = "id")
	Label label;

	/**
	 * @return the times
	 */
	public int getTimes() {
		return times;
	}

	/**
	 * @param times
	 *            the times to set
	 */
	public void setTimes(int times) {
		this.times = times;
	}

	/**
	 * @return the label
	 */
	public Label getLabel() {
		return label;
	}

	/**
	 * @param label
	 *            the label to set
	 */
	public void setLabel(Label label) {
		this.label = label;
	}

	/**
	 * @return the wechatid
	 */
	public int getWechatid() {
		return wechatid;
	}

	/**
	 * @param wechatid
	 *            the wechatid to set
	 */
	public void setWechatid(int wechatid) {
		this.wechatid = wechatid;
	}

	/**
	 * @return the classid
	 */
	public int getClassid() {
		return classid;
	}

	/**
	 * @param classid
	 *            the classid to set
	 */
	public void setClassid(int classid) {
		this.classid = classid;
	}

	/**
	 * @return the update_time
	 */
	public Date getUpdate_time() {
		return update_time;
	}

	/**
	 * @param update_time
	 *            the update_time to set
	 */
	public void setUpdate_time(Date update_time) {
		this.update_time = update_time;
	}

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		this.user = user;
	}


	public Float getConfidence() {
		return confidence;
	}

	public void setConfidence(Float confidence) {
		this.confidence = confidence;
	}

	/**
	 * @param id
	 * @param wechatid
	 * @param classid
	 * @param update_time
	 * @param label
	 */
	public WechatClassMap(int wechatid, int classid, int occurTime,
			Date update_time) {
		super();
		this.wechatid = wechatid;
		this.classid = classid;
		this.update_time = update_time;
		this.times = 1;
	}

	public WechatClassMap(int wechatid, int classid, Date update_time,
			String ip, String user, Float confidence, int times) {
		super();
		this.wechatid = wechatid;
		this.classid = classid;
		this.update_time = update_time;
		this.ip = ip;
		this.user = user;
		this.confidence = confidence;
		this.times = times;
	}

	/**
	 * 
	 */
	public WechatClassMap() {
	}

	public void inc() {
		times++;
	}

	public void inc(int num) {
		times += num;
	}

}
